package com.zs.games.resultTool;

import lombok.Getter;

@Getter
public enum ResultCodeEnum {

    SUCCESS(200,"执行成功"),

    TOKEN_ERR(401,"token错误"),
    UNEXIST_URL(404,"URL不存在"),

    UNEXIST_ERROR(404,"用户不存在或密码有误"),

    UNKNOWN_ERROR(520,"未知错误"),

    SYSTEM_ERROR(500, "服务器开小差了，请稍后再试"),

    PARAM_ERROR(201,"参数错误"),

    NULL_POINTER(202,"空指针异常"),

    SAVE_ERROR(204,"数据添加失败"),

    UPDATE_ERROR(205,"数据修改失败"),

    DOWNLOAD_ERROR(206,"数据下载失败"),

    DATA_NOT_EXIST(207,"数据不存在或已删除"),

    COMMENT_DATA_NOT_EXIST(208,"评论数据不存在或已删除"),

    ALREADY_EXIST(209,"你已经操作过了"),

    USER_NAME_ALREADY_EXIST(210,"该用户名已存在"),

    COMMENT_DELETE_ERROR(211,"只能删除自己的评论"),

    FAIL(99999, "操作失败，请稍后重试"),


     ;
    // 响应状态码
    private long code;
    // 响应信息
    private String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    public String getCodeMsg() {
        return this.code + ":" + this.getMessage();
    }
}
